﻿using Occt;

namespace Tx.OCC
{
    public static class OccBndBoxEx
    {
        /// <summary>
        /// Centers the specified box.
        /// </summary>
        /// <param name="box">The box.</param>
        /// <returns>gp_Pnt.</returns>
        public static gp_Pnt Center(this Bnd_Box box)
        {
            return (box.CornerMin + box.CornerMax) * 0.5;
        }

        /// <summary>
        /// Extentses the specified box.
        /// </summary>
        /// <param name="box">The box.</param>
        /// <returns>System.ValueTuple&lt;System.Double, System.Double, System.Double&gt;.</returns>
        public static gp_Pnt Extents(this Bnd_Box box)
        {
            return box.CornerMax - box.CornerMin;
        }

    }
}
